﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="OpenDate.aspx.cs" Inherits="Physio_Clinic.WebForm6" %>
<%@ Register assembly="Devart.Data.Linq.Web, Version=3.1.34.0, Culture=neutral, PublicKeyToken=09af7300eec23701" namespace="Devart.Data.Linq.Web" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% if (currentUser != null && currentUser.Username == "admin")
       {   
      %>
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" BackColor="White" BorderColor="White" 
            BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" 
            DataKeyNames="Id" DataSourceID="DbLinqDataSource1" GridLines="None" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            RowHeaderColumn="BookId" ShowHeaderWhenEmpty="True" Width="709px" 
            onrowcommand="GridView1_RowCommand" 
        onrowcreated="GridView1_RowCreated">
        <Columns>
            <asp:ButtonField ButtonType="Button" HeaderText="เเก้ไข" Text="เเก้ไข" />
            <asp:BoundField DataField="DayOfweekName" HeaderText="วันเปิดทำการ" 
                SortExpression="DayOfweekName" />
            <asp:BoundField DataField="OpenStatusName" HeaderText="สถานะเปิดทำการ" 
                SortExpression="OpenStatusName" />
            <asp:BoundField DataField="DoctorName" HeaderText="ชื่อเเพทย์" 
                SortExpression="DoctorName" />
        </Columns>
        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#594B9C" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#33276A" />
    </asp:GridView>
    <cc1:DbLinqDataSource ID="DbLinqDataSource1" runat="server" 
        ContextTypeName="Physio10Context.Physio10DataContext" EntityTypeName="" 
        TableName="Opendates">
    </cc1:DbLinqDataSource>
    <br />
    <br />
            <%     if (Session["currentOpenDate"] != null)
                   {%>
    <asp:Table ID="MyTable" runat="server" border="1" CellPadding="5" CellSpacing="0"
        Height="132px" Width="494px">
        <asp:TableRow ID="TableRow1" runat="server" BackColor="Blue">
            <asp:TableCell ID="TableCell1" runat="server" colspan="2">
                <asp:Label ID="Label4" Text="วันเปิดทำการ" runat="Server" ForeColor="White" />
            </asp:TableCell></asp:TableRow><asp:TableRow ID="TableRow2" runat="server">
            <asp:TableCell ID="TableCell2" runat="server">
                <asp:Label ID="Label5" runat="server" Text="วันทำการ"></asp:Label>
            </asp:TableCell><asp:TableCell ID="TableCell4" runat="server">
                <asp:Label ID="Label9" runat="server" Text="Sunday"></asp:Label>
            </asp:TableCell></asp:TableRow><asp:TableRow ID="TableRow3" runat="server">
            <asp:TableCell ID="TableCell3" runat="server">
                <asp:Label ID="Label1" runat="server" Text="สถานะเปิดทำการ"></asp:Label>
            </asp:TableCell><asp:TableCell ID="TableCell5" runat="server">
                <asp:DropDownList 
        ID="DropDownDateStatus" runat="server"><asp:ListItem Value="1">เปิดทำการ</asp:ListItem><asp:ListItem 
            Value="2">ปิดทำการ</asp:ListItem></asp:DropDownList>
            </asp:TableCell></asp:TableRow><asp:TableRow ID="TableRow4" runat="server">
            <asp:TableCell ID="TableCell6" runat="server">
                <asp:Label ID="Label2" runat="server" Text="ชื่อเเพทย์"></asp:Label>
            </asp:TableCell><asp:TableCell ID="TableCell7" runat="server">
                <asp:DropDownList 
        ID="DoctorDropDownList" runat="server" DataSourceID="DbLinqDataSource2" 
        DataTextField="DoctorName" DataValueField="DoctorId"></asp:DropDownList>
            </asp:TableCell></asp:TableRow></asp:Table><cc1:DbLinqDataSource 
        ID="DbLinqDataSource2" runat="server" 
        ContextTypeName="Physio10Context.Physio10DataContext" EntityTypeName="" 
        TableName="Doctors"></cc1:DbLinqDataSource><br /><asp:Button 
        ID="Button1" runat="server" Text="บันทึก" Width="105px" 
        onclick="Button1_Click" /><br />
        <% } %>

    <% }
       else
       { %><asp:Label ID="ErrorText" runat="server" 
    Text="สิทธิหน้านี้สำหรับ ผู้ดูเเลระบบเท่านั้น " ForeColor="Red" 
        style="text-align: center"></asp:Label><asp:HyperLink ID="HyperLink1" 
    runat="server" NavigateUrl="http://physio10.com/" > click</asp:HyperLink><% } %></asp:Content>